{% extends "base.html" %}
{% block content %}
<head>
    <title>User_Complete</title>
    {{ css_media.media }}
</head>

<body>

    <h3>
        <p> Timesheet: {{ first_name }} {{ last_name }} </p>
    </h3>

    <a class="link" href="{% url user %}"> User </a> <br><br>
    
    <div align="center">
    
    <a class="linkArrow" href="{{ week_prev }}"> Previous </a>
    <a class="linkArrow" href="{{ week_next }}"> Next </a>
    <br><br>
    
    <table class="Table">
        <tr>
        <th></th>
        <form action="" method=post>
        {% for list in list_day %}
            <th class="TableDateCell">{{ list.1 }}<br>{{ list.0 }}</th>
        {% endfor %}
        <th class="TableTotalHead" id="TotalHeadRight"> Total </th>
        </tr>
        {% if data %}
        {% for list in data %}
            <tr class="TableString">
                <td class="ProjectField"> {{ list.0 }} </td>
                <td> </td> <td> </td>
                <td> </td> <td> </td>
                <td> </td> <td> </td>     
                <td> </td> <td> </td>
            </tr>
            {% for lst1 in list.1 %}
            <tr>
               <td class="ActivityCell"> {{ lst1.0 }} </td>
                {% for lst2 in lst1.1 %}
                        <td class="TableCell">
                        {% if lst2.2 %}
                            <input type="Text" size="8" value="{{ lst2.1 }}" readonly class="TableFieldForm" id="Complete"/>
                        {% else %}
                            <input type="Text" size="8" name="{{ list.0 }} {{ lst1.0 }} {{ lst2.0 }}" 
                                   value="{{ lst2.1 }}" class="TableFieldForm" id="NotComplete"/>                        
                        {% endif %}
                        </td>
                {% endfor %}
                <td class="TableTotalCell"> {{ total_time_right.next }} </td>
            {% endfor %}        
        {% endfor %}
        <tr></tr>
        <tr>
            <td class="TableTotalHead"> Total </td>
            {% for tt in total_time_down %}
                <td class="TableTotalCell"> {{ tt }} </td>
            {% endfor %}
            <td class="TableTotalCell" id="AllTime"> {{ all_time }} </td>
        </tr>
        <tr>
            <td colspan="9" class="TableButtonCell"> 
                <input type="submit" name="Save" size="5" value="Save"/>
                <input type="submit" name="Complete" size="5" value="Complete"/>                 
            </td>
        </tr>
        </form>
        {% endif %}
    </table>
    <br><br>
    </div>
    <div class="link">
        <p><a id="logout" href="{% url auth_logout %}">Logout</a>.</p>
    </div>
</body>

{% endblock %}